<script language="javascript">
var dialogWidth=$(window).width()*0.2;
var dialogHeight=$(window).height()*0.06*2;
$(function(){
	$("#searchBtn").click(function(){
		artDialog(
		        {	
			        'title':'按条件查询',
			        width:dialogWidth,
			        height:  dialogHeight ,
			        okVal:"查询",
			        cancelVal:'关闭',
		            content:"<form id='searchForm' method='get' action='/invite/detail'>"+$('#searchdiv').html()+"</form>",
		            lock:true,
		        },
		        function(){
		                $('#searchForm').submit();
		        },
		        function(){
		            return true;
		        }
		);
		});
});
</script>
<!--  搜索表单  -->
<div  id="searchdiv" style="display:none;">
<input  type='hidden'  name='sid' value='<?php echo $sid?>'/>
 <table style="width:100%;height:100%" border=0>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >推荐人UID</td><td  valign='middle' align="left"  >
		<input type='text' name="master" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['master'])?$get['master']:''?>' />
	  </td>
	</tr>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >邀请人UID</td><td  valign='middle' align="left"  >
		<input type='text' name="slave" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['slave'])?$get['slave']:''?>' />
	  </td>
	</tr>
 </table>
  <input  type="submit" value="提交"   style="display:none" />
</div>

<div class="container-fluid">
    <div class="widget-box">
		<div class="widget-title">
			<span class="icon">
				<i class="icon-th"></i>
			</span>
			<h5>经纪人提成明细</h5>
			<span style="height:38px;line-height:38px;">
				<input class="btn btn-success btn-mini" type="button" style="cursor:pointer" id='searchBtn'  value="搜索条件">
				<a  href="/invite/detail?sid=<?php echo $sid;?>" class="btn btn-info btn-mini">清空查询</a>
			</span>
		</div>
		<div class="widget-content nopadding">
			<table   style="width:100%" class='table table-bordered table-striped'>
				<thead>
				<?php if(!empty($master)){?>
				<tr class="strong">
					<th colspan='6' style="text-align:right;">总提成：￥ <?php echo empty($total['cny'])?'0.00':$total['cny'];?>&nbsp;&nbsp;&nbsp;&nbsp;总交易额：￥ <?php echo empty($total['trade_cny'])?'0.00':$total['trade_cny'];?></th>
				</tr>
				<?php }?>
				<tr class="strong">
					<th>推荐人UID</th>
					<th>邀请人UID</th>
					<th>交易金额</th>
					<th>分成比例</th>
					<th>提成</th>
					<th>日期</th>
				</tr>
				</thead>
				<tbody>
				<?php if(!empty($page_data)) foreach($page_data as $items){?>
				<tr>
					<td><?php echo $items['master'];?></td>
					<td><?php echo $items['slave'];?></td>					
					<td>￥<?php echo $items['trade_cny'];?></td>
					<td><?php echo $items['rate']*100;?>%</td>
					<td>￥<?php echo $items['cny'];?></td>
					<td><?php echo $items['date'];?></td>
				</tr>            		
				<?php }?>
				</tbody>
			</table>
		</div>
		<div id="page" style="width:50%" class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers">
		   <?php echo $page_html;?>
		</div>
  </div>
  </div>